<div id="addMachineLocationModel" class="modal fade" role="dialog" aria-labelledby="exampleModalLabel"
    aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-body">
                <h3 class="m-t-none m-b ">
                    <vc:i18n name="添加" namespace="addMachineLocation"></vc:i18n>
                </h3>
                <div class="ibox-content">
                    <div>
                        <div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">
                                    <vc:i18n name='位置名称' namespace='addMachineLocation'></vc:i18n>
                                </label>
                                <div class="col-sm-10">
                                    <input v-model="addMachineLocationInfo.locationName" type="text"
                                        :placeholder="vc.i18n('必填，请填写位置名称','addMachineLocation')" class="form-control">
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">
                                    <span><vc:i18n name="位置类型" namespace="addMachineLocation"></vc:i18n></span>
                                </label>
                                <div class="col-sm-10">
                                    <select class="custom-select" v-model="addMachineLocationInfo.locationType"
                                            >
                                        <option selected disabled value="">
                                            {{vc.i18n('必填，请选择位置类型','addMachineLocation')}}
                                        </option>
                                        <option value="1000">{{vc.i18n('小区','addMachineLocation')}}</option>
                                        <option value="6000">{{vc.i18n('楼栋','addMachineLocation')}}</option>
                                        <option value="2000">{{vc.i18n('单元','addMachineLocation')}}</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group row" v-if="addMachineLocationInfo.locationType == '2000' || addMachineLocationInfo.locationType == '6000' ">
                                <label class="col-sm-2 col-form-label">
                                    <vc:i18n name="楼栋" namespace="addMachineLocation"></vc:i18n>
                                </label>
                                <div class="col-sm-4">
                                    <select class="custom-select" v-model="addMachineLocationInfo.floorId"
                                            @change="_loadUnits()">
                                        <option selected disabled value="">
                                            {{vc.i18n('必填，请选择楼栋','addMachineLocation')}}
                                        </option>
                                        <option :value="item.floorId" v-for="(item,index) in addMachineLocationInfo.floors">{{item.floorName}}</option>
                                    </select>
                                </div>
                                <label class="col-sm-2 col-form-label text-right" v-if="addMachineLocationInfo.locationType == '2000'">
                                    <vc:i18n name="单元" namespace="addMachineLocation"></vc:i18n>
                                </label>
                                <div class="col-sm-4" v-if="addMachineLocationInfo.locationType == '2000'">
                                    <select class="custom-select" v-model="addMachineLocationInfo.unitId">
                                        <option selected disabled value="">
                                            {{vc.i18n('必填，请选择单元','addMachineLocation')}}
                                        </option>
                                        <option :value="item.unitId" v-for="(item,index) in addMachineLocationInfo.units">{{item.unitNum}}</option>
                                    </select>
                                </div>
                            </div>
                            <div class="ibox-content">
                                <button class="btn btn-primary float-right" type="button"
                                    v-on:click="saveMachineLocationInfo()"><i class="fa fa-check"></i>&nbsp;
                                    <span>
                                        <vc:i18n name="保存"></vc:i18n>
                                    </span>
                                </button>
                                <button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
                                    data-dismiss="modal">
                                    <vc:i18n name="取消"></vc:i18n>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>